import { shopStatReturnOrders } from '../../services/API';
export default async function (valuePanels) {
  console.log(valuePanels);
  try {
    for (const key in valuePanels) {
      valuePanels[key] && valuePanels[key].toggleLoading(true);
    }
    // valuePanel.toggleLoading(true);
    const resp = await shopStatReturnOrders();
    const data = resp.data;
    for (let key in data) {
      valuePanels[key] && valuePanels[key].setValue(data[key]);
    }
  } catch (err) {
    for (const key in valuePanels) {
      valuePanels[key] && valuePanels[key].setValue('--');
    }
  } finally {
    for (const key in valuePanels) {
      valuePanels[key] && valuePanels[key].toggleLoading(false);
    }
  }
}
